package com.sourny.auth.interceptor;

import com.sourny.auth.consts.SecurityAuthConst;
import com.sourny.auth.task.TokenTask;
import feign.RequestInterceptor;
import feign.RequestTemplate;

/**
 * Feign添加认证信息
 *
 * @author sourny.yang
 * @date 16:04 2018/6/7
 */
public class FeignSecurityAuthRequestInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate template) {
        template.header(SecurityAuthConst.AUTHORIZATION, TokenTask.getToken());
    }
}
